package ch7;
//飞行员
public class Aviator {
    private String name,sex;
    private int age;

    public Aviator(String name, String sex, int age) {
        this.name = name;
        this.sex = sex;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    public void drive(Plane p){
        System.out.println("这个飞行员的名字是："+this.name+",性别"+this.sex+",今年"+this.age+"岁。");
        System.out.println("他可以驾驶"+p.getName());
        p.takeOff();
        p.acceleration();
        p.land();
    }
}
